<?php
                include($_SERVER['DOCUMENT_ROOT'].'/wewant1/includes/db_exe/db_connection.php');
                    $db = connectDb();
                    //lay tat ca thong tin san pham tu bang duoc join giua bang product va bang follows 
                    //dùng id_product va select ra cac dong dung id_user_to la id cua nguoi dung
                    
                    $q = "SELECT p.id_product,p.product_name,p.product_url,p.product_price,p.image_src FROM products AS p LIMIT 8 OFFSET ";
                   
                    $r = exeQuery($db,$q);
                    while($row = mysqli_fetch_array($r,MYSQLI_ASSOC)) { 
                    ?>
                    
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="Product Detail.html" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src=<?php echo "../upload/image_product/x354-{$row['image_src']}.jpg" ?> >
                                </a>
                                <?php if($row['product_price'] >0) echo "<span class='price-tag'>{$row['product_price']} đ</span>";  ?> <!-- neu price > 0 thi hien span -->
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card"><?php echo "{$row['product_name']}"; ?></h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>

                    <?php }
                    mysqli_close($db);
                    unset($row);
                    ?>